package com.github.xzb617.sample;

import com.github.xzb617.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @author xzb617
 * @date 2022/5/16 9:43
 * @description:
 */
public class TreeModel {

    @TreeNodeId
    private Long id;

    @TreeNodeLabel
    private String name;

    @TreeNodePid
    private Long parentId;

    @TreeNodeLevel
    private Integer level;

    @TreeNodeOrder
    private Integer order;

    @TreeNodeChildren
    private List<TreeModel> children = new ArrayList<>();

    public TreeModel(Long id, String name, Long parentId, Integer level) {
        this.id = id;
        this.name = name;
        this.parentId = parentId;
        this.level = level;
    }

    public TreeModel(Long id, String name, Long parentId, Integer level, Integer order) {
        this.id = id;
        this.name = name;
        this.parentId = parentId;
        this.level = level;
        this.order = order;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public List<TreeModel> getChildren() {
        return children;
    }

    public void setChildren(List<TreeModel> children) {
        this.children = children;
    }

    public Integer getOrder() {
        return order;
    }

    public void setOrder(Integer order) {
        this.order = order;
    }

    @Override
    public String toString() {
        return "TreeModel{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", parentId=" + parentId +
                ", level=" + level +
                ", children=" + children +
                '}';
    }

}
